class Solution(object):
    def lengthOfLastWord(self, s):
        """
        :type s: str
        :rtype: int
        """
        s = s.strip()
        l = s.split(' ')
        if len(l)==0:return 0
        else: return len(l[-1])